using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Accountability4net;

namespace Accountability4net.Client.Controls
{
    public partial class AccountDetailsControl : UserControl
    {
        private IAccount account_;
        public AccountDetailsControl()
        {
            InitializeComponent();
            typeComboBox_.DataSource = Enum.GetValues(typeof(AccountType));
        }

        public AccountDetailsControl(IAccount account)
            :this()
        {
            Account = account;
        }

        public IAccount Account
        {
            get
            {
                return account_;
            }
            set
            {
                account_ = value;
                nameTextBox_.Text = account_.Name;
                numberTextBox_.Text = account_.Number.ToString();
                descriptionTextBox_.Text = account_.Description;
                balanceTextBox_.Text = account_.Balance.ToString();
            }
        }

    }
}
